package org.example.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import jakarta.validation.constraints.NotEmpty;
import org.example.validation.StateValidation;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Documented
@Target({FIELD})
@Retention(RUNTIME)
@Constraint(validatedBy = {StateValidation.class })//指定校验规则的类
public @interface State {
    //提示校验失败的信息
    String message() default "状态值错误";
    //制定分组
    Class<?>[] groups() default { };
    //负载 获取到sate注解的附加信息
    Class<? extends Payload>[] payload() default { };
}
